package cn.com.oidreams.wechat.robot.enums;

import cn.com.oidreams.common.enums.ICommonEnum;
import cn.com.oidreams.wechat.robot.entity.*;
import cn.com.oidreams.wechat.robot.service.*;
import cn.com.oidreams.wechat.robot.service.interfaces.IRobot;
import lombok.Getter;

/***
 ** @category 请用一句话描述这个类的用途
 ** @author qing.yunhui
 ** @email: qingyh@glodon.com
 ** @createTime: 2021-12-14 19:28
 **/
public class WeXinTalkEnum {

    @Getter
    /**
     * <p>消息类型</p>
     * */
    public enum MSG_TYPE implements ICommonEnum {
        TEXT( "text","文本消息", TextMsgService.class, TextMsgRequest.class),
        IMAGE("image","图片类型的消息", ImageMsgService.class, ImageMsgRequest.class),
        MARKDOWN("markdown","markdown消息", MarkDownMsgService.class, MarkDownMsgRequest.class),
        NEWS("news","图片类型", NewsMsgService.class, NewsMsgRequest.class),
        FILE("file","文件类型",FileMsgService.class,FileMsgRequest.class),
        TEMPLATE_CARD("template_card","模版卡片类型", TemplateCardMsgService.class, TemplateCardMsgRequest.class);
        private final String code;
        private final String value;
        private final Class<?extends AbsWeXinTalkMessage> service;
        private final Class<?extends BaseRequest> request;
        MSG_TYPE(String code, String value){ this(code,value,null,null); }
        MSG_TYPE(String code, String value,Class<?extends AbsWeXinTalkMessage> service,Class<?extends BaseRequest> request) {
            this.code = code;
            this.value = value;
            this.service=service;
            this.request=request;
        }
        @Override
        public Integer getKey() { return null; }
    }

    /**
     * <p>@类型(userId、或手机号)</p>
     * */
    @Getter
    public enum AT_TYPE implements ICommonEnum{
        USER_ID("userid","@userid"),
        MOBILE("mobile","@mobile");
        private final String code;
        private final String value;
        AT_TYPE(String code, String value){
            this.code=code;
            this.value=value;
        }
        @Override
        public Integer getKey() { return null; }
    }

    /**
     * <p>机器人</p>
     * */
    @Getter
    public enum ROBOT implements IRobot {
        XIAO_TIAN("37642949-03e1-495a-83a1-d1de6e9a5583","小天","apple","[苹果-群]");
        /**
         * <p>机器人 webhook的key</p>
         * */
        private final String code;
        /**
         * <p>机器人名称</p>
         * */
        private final String value;
        /**
         * <p>群编码</p>
         * */
        private final String groupCode;
        /**
         * <p>群名称</p>
         * */
        private final String groupName;
        ROBOT(String code, String value,String groupCode,String groupName) {
            this.code = code;
            this.value = value;
            this.groupCode=groupCode;
            this.groupName=groupName;
        }
        @Override
        public Integer getKey() { return null; }
    }

}
